package com.certification.servlet.capitulo10;

import java.io.IOException;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;

public class SimpleTagTest4 extends SimpleTagSupport {
	
	@Override
	public void doTag() throws JspException, IOException {
		String[] movies = {"O senhor do seu anel","As transas do rei careca",
				"cidade das budegass"};
		//Cada loop do tag handler reinicia o valor do atributo "movie"
		//e chama getJspBody.invoke novamente
		for (int i = 0; i < movies.length; i++) {
			getJspContext().setAttribute("movie", movies[i]);
			getJspBody().invoke(null);
		}
	}
	
}
